﻿
''' <summary>
''' A measure is an actual measurement of something.
''' </summary>
''' <remarks></remarks>
Public Class Measure

    Private m_measureType As MeasureTypeEnum
    Private m_value As Double
    Private m_unit As Integer

    ''' <summary>
    ''' Gets the MeasureType
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public ReadOnly Property MeasureType() As MeasureTypeEnum
        Get
            Return m_measureType
        End Get
    End Property
    ''' <summary>
    ''' A unit which represents the power of 10 that has to be multipled by value to find the actual data (integer).
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public ReadOnly Property Unit() As Integer
        Get
            Return m_unit
        End Get
    End Property
    ''' <summary>
    ''' Returns the calculated Value. 
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function CalculateValue() As Double
        Return m_value * 10 ^ m_unit
    End Function

    ''' <summary>
    ''' Creates a new measure instance
    ''' </summary>
    ''' <remarks></remarks>
    Friend Sub New(ByVal value As Double, ByVal unit As Integer, ByVal measureType As MeasureTypeEnum)
        m_measureType = measureType
        m_value = value
        m_unit = unit
    End Sub

End Class
